<?php 
//define('NO_CHECK_LOGIN','ture');
require 'init.php';
if(isset($_SESSION['cms']['admin'])){
		$user=$_SESSION['cms']['admin'];
	}
if ( @$user[ 'username' ] != '' ) {
    $userid=$user['userid'];
    $login="退出登录";
	$herf="../model/userdata.php?";
	if(file_exists("../../upload/userphoto/userphoto_$userid.jpg")){
          $photo = "../../upload/userphoto/userphoto_$userid.jpg";  
        }else{
          $photo = "../../upload/userphoto/userphoto_0.jpg";
        }
    }else{
    $login="去登录";
	$herf="../view/login.html";                
	$photo = "../../upload/userphoto/userphoto_0.jpg";
    }
    $result=mysqli_query($link,"SELECT * FROM `dy1table` ORDER BY `dy1id` DESC") ;
    $dy1data = mysqli_fetch_all($result,MYSQLI_ASSOC);
    $i=0;

    $hostdir1='../../upload/dynamic2/life'; //要读取的文件夹
    $filesnames1 = scandir($hostdir1); //得到所有图片
    array_splice($filesnames1,0,2); 
    
    $hostdir2='../../upload/dynamic2/study'; //要读取的文件夹
    $filesnames2 = scandir($hostdir2); //得到所有图片
    array_splice($filesnames2,0,2);
    
    $hostdir3='../../upload/dynamic2/myself'; //要读取的文件夹
    $filesnames3 = scandir($hostdir3); //得到所有图片
    array_splice($filesnames3,0,2);
    
    $hostdir4='../../upload/dynamic2/other'; //要读取的文件夹
    $filesnames4 = scandir($hostdir4); //得到所有图片
    array_splice($filesnames4,0,2); 
require '../view/dynamic.html';